package edu.hwadee.BEIS.entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.JSON;

/**
 * SchoolUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "school_user", catalog = "beis")

public class SchoolUser implements java.io.Serializable {

	// Fields

	private String schoolUserId;
	private Certificate certificate;
	private SchoolBasicInfor schoolBasic;
	private String schoolUserPwd;
	private String schoolUserPhone;

	// Constructors

	/** default constructor */
	public SchoolUser() {
	}

	/** minimal constructor */
	public SchoolUser(String schoolUserId, Certificate certificate, String schoolUserPwd, String schoolUserPhone) {
		this.schoolUserId = schoolUserId;
		this.certificate = certificate;
		this.schoolUserPwd = schoolUserPwd;
		this.schoolUserPhone = schoolUserPhone;

	}

	// Property accessors
	@Id

	@Column(name = "schooluser_id", unique = true, nullable = false, length = 50)

	public String getSchoolUserId() {
		return this.schoolUserId;
	}

	public void setSchoolUserId(String schoolUserId) {
		this.schoolUserId = schoolUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "certificate_id", nullable = false)

	public Certificate getCertificate() {
		return this.certificate;
	}

	public void setCertificate(Certificate certificate) {
		this.certificate = certificate;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "school_id")

	public SchoolBasicInfor getSchoolBasic() {
		return this.schoolBasic;
	}

	public void setSchoolBasic(SchoolBasicInfor schoolBasic) {
		this.schoolBasic = schoolBasic;
	}

	@Column(name = "schooluser_pwd", nullable = false, length = 32)

	public String getSchoolUserPwd() {
		return this.schoolUserPwd;
	}

	public void setSchoolUserPwd(String schoolUserPwd) {
		this.schoolUserPwd = schoolUserPwd;
	}

	@Column(name = "schooluser_phone", nullable = false, length = 20)

	public String getSchoolUserPhone() {
		return this.schoolUserPhone;
	}

	public void setSchoolUserPhone(String schoolUserPhone) {
		this.schoolUserPhone = schoolUserPhone;
	}

	@Override
	public String toString() {
		return JSON.toJSONString(this);
	}

}